package goover.unit03;

import java.util.ArrayList;

import java.util.Collections;

public class CollectionsDemo01 {
    public static void main(String[] args){
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"Z","B","C");
        System.out.println(list);
        Collections.reverse(list);
        System.out.println(list);
        Collections.sort(list);
        int i = Collections.binarySearch(list, "Z");
        System.out.println(i);
        System.out.println(list);
        Collections.swap(list,0,list.size() - 1);
        System.out.println(list);
        System.out.println(Collections.max(list));
        System.out.println(Collections.min(list));
        Collections.replaceAll(list,"Z","A");
        System.out.println(list);
    }
}
